
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.lcdui.game.TiledLayer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author tien
 */
public class Desert extends Map{
    TiledLayer tlRock;
    
    public Desert(GameScreen canvas) throws IOException {
        super(canvas);
        
        this.tlThings = this.canvas.getGameDesign().getThingsDesert();
        this.tlWater = this.canvas.getGameDesign().getWaterDesert();
        this.tlBase = this.canvas.getGameDesign().getBaseDesert();
        this.tlRock = this.canvas.getGameDesign().getRockDesert();
        
        
        this.waterAnimator = new TileAnimationTask(tlWater, this.canvas.getGameDesign().animWaterWaterLake, this.canvas.getGameDesign().WaterSeq01, true);
        this.canvas.getTimer().scheduleAtFixedRate(this.waterAnimator, 0, this.canvas.getGameDesign().WaterSeq01Delay);
    }
    
    public String getRMSName() {
      return "MushroomGameDesert";
  }

    boolean checkCollideWithRock(Sprite sprite) {
        return sprite.collidesWith(tlRock, true);
    }
    
    boolean checkCollide(Sprite sprite) {
        return super.checkCollide(sprite) || this.checkCollideWithRock(sprite);
    }
}
